export default {
  state() {
    return {
      ratedList: [],
    };
  },
  mutations: {
    getRatedList(state, payload) {
      state.ratedList = payload;
    },
  },
  actions: {
    getRatedListAsync(context) {
      return new Promise((resolve) => {
        fetch("http://101.35.148.193:3000/api/rated/list")
          .then((response) => response.json())
          .then((res) => {
            if (res.success) {
              context.commit("getRatedList", res.data);
              resolve();
            }
          });
      });
    },
  },
};
